package cn.yunhe.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.yunhe.dao.PatientDao;
import cn.yunhe.entity.Patient;
import cn.yunhe.service.PatientService;

@Service("patientService")
public class PatientServiceImpl implements PatientService {
	@Autowired
	private PatientDao patientDao;

	@Override
	public List<Patient> findPatientAll() {
		System.out.println("=========findPatientAll()!!!!============");

		return patientDao.findPatientAll();
	}

	@Override
	public int addPatient(Patient patient) {
		System.out.println("=========addPatient()!!!!============");

		return patientDao.addPatient(patient);
	}

	// set get 方法
	public PatientDao getPatientDao() {
		return patientDao;
	}

	public void setPatientDao(PatientDao patientDao) {
		this.patientDao = patientDao;
	}

	@Override
	public int deleteByPstate(int pid) {
		// TODO Auto-generated method stub
		return patientDao.deleteByPstate(pid);
	}

	@Override
	public Patient findPatientByPid(int pid) {

		System.out.println("================修改!!!service层==============");
		return patientDao.findPatientByPid(pid);
	}

	@Override
	public int updatePatient(Patient patient) {
		// TODO Auto-generated method stub
		return patientDao.updatePatient(patient);
	}

	@Override
	public List<Patient> findPatientBySname(String sname) {
		System.out.println("======模糊查询================");
		return patientDao.findPatientBySname(sname);
	}

	@Override
	public List<Patient> findPatient() {
		// TODO Auto-generated method stub
		return patientDao.findPatient();
	}

}
